<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>MecGridOLAPSample.mxml</title>
<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot;?&gt;</span>
<span class="MXMLComponent_Tag">&lt;mx:Application</span><span class="MXMLDefault_Text"> xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot;
        creationComplete=&quot;</span><span class="ActionScriptDefault_Text">creationCompleteHandler</span><span class="ActionScriptBracket/Brace">()</span>;<span class="MXMLDefault_Text">&quot; xmlns:MecGrid=&quot;</span><span class="MXMLString">com.mechan.MecGrid.*</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>

    <span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
      <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">rpc</span>.<span class="ActionScriptDefault_Text">AsyncResponder</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">rpc</span>.<span class="ActionScriptDefault_Text">AsyncToken</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">OLAPQuery</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">OLAPSet</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">IOLAPQuery</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">IOLAPQueryAxis</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">IOLAPCube</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">olap</span>.<span class="ActionScriptDefault_Text">OLAPResult</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">CubeEvent</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">Alert</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">collections</span>.<span class="ActionScriptDefault_Text">ArrayCollection</span>;
        
        
        <span class="ActionScriptComment">//
</span>        <span class="ActionScriptComment">// Format of Objects in the ArrayCollection:
</span>        <span class="ActionScriptComment">//
</span>        <span class="ActionScriptComment">//  data:Object = {
</span>        <span class="ActionScriptComment">//    customer:&quot;AAA&quot;, 
</span>        <span class="ActionScriptComment">//    product:&quot;ColdFusion&quot;,
</span>        <span class="ActionScriptComment">//    quarter:&quot;Q1&quot;
</span>        <span class="ActionScriptComment">//    revenue: &quot;100.00&quot; 
</span>        <span class="ActionScriptComment">//  }
</span>        <span class="ActionScriptComment">//
</span>
        <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">flatData</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ArrayCollection</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">(</span>
        <span class="ActionScriptBracket/Brace">[</span>
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>25<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>25<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>250, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>125<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>430, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>75<span class="ActionScriptBracket/Brace">}</span>,

         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>125, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>320, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>280, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>70<span class="ActionScriptBracket/Brace">}</span>,

         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>375, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>430, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>470, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>220<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>570, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>170<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>215, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>90<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>90<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>175, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>190<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>670, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>75<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>175, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>,<span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>120, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>310, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>70<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>385, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>340, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>470, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>220<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>270, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>170<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>100, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>25<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>150, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>25<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>200, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>125<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>300, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>75<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>175, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>100, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>270, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>370, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>70<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>410, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>300, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>320<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>510, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>220<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>620, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>170<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>215, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>90<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>210, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>90<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>175, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>190<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;AAA&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>420, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>75<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>240, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>100, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>20<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>270, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;BBB&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>370, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>70<span class="ActionScriptBracket/Brace">}</span>,
    
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;ColdFusion&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q1&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>375, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flex&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q2&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>420, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>120<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Dreamweaver&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q3&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>680, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>220<span class="ActionScriptBracket/Brace">}</span>,
         <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">customer</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;CCC&quot;</span>, <span class="ActionScriptDefault_Text">product</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Flash&quot;</span>, <span class="ActionScriptDefault_Text">quarter</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&quot;Q4&quot;</span>, <span class="ActionScriptDefault_Text">revenue</span><span class="ActionScriptOperator">:</span>570, <span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptOperator">:</span>170<span class="ActionScriptBracket/Brace">}</span>         
        <span class="ActionScriptBracket/Brace">])</span>;
    
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">creationCompleteHandler</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// You must initialize the cube before you 
</span>            <span class="ActionScriptComment">// can execute a query on it.
</span>            <span class="ActionScriptDefault_Text">myMXMLCube</span>.<span class="ActionScriptDefault_Text">refresh</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptComment">// Create the OLAP query.
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getQuery</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cube</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPCube</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPQuery</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// Create an instance of OLAPQuery to represent the query. 
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">query</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">OLAPQuery</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">OLAPQuery</span>;
            
            <span class="ActionScriptComment">// Get the row axis from the query instance.
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">rowQueryAxis</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPQueryAxis</span> <span class="ActionScriptOperator">=</span> 
                <span class="ActionScriptDefault_Text">query</span>.<span class="ActionScriptDefault_Text">getAxis</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">OLAPQuery</span>.<span class="ActionScriptDefault_Text">ROW_AXIS</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// Create an OLAPSet instance to configure the axis.
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">productSet</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">OLAPSet</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">OLAPSet</span>;
            <span class="ActionScriptComment">// Add the Product to the row to aggregate data 
</span>            <span class="ActionScriptComment">// by the Product dimension.
</span>            <span class="ActionScriptDefault_Text">productSet</span>.<span class="ActionScriptDefault_Text">addElements</span><span class="ActionScriptBracket/Brace">(</span>
                <span class="ActionScriptDefault_Text">cube</span>.<span class="ActionScriptDefault_Text">findDimension</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;ProductDim&quot;</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">findAttribute</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Product&quot;</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">children</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// Add the OLAPSet instance to the axis.
</span>            <span class="ActionScriptDefault_Text">rowQueryAxis</span>.<span class="ActionScriptDefault_Text">addSet</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">productSet</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptComment">// Get the column axis from the query instance, and configure it
</span>            <span class="ActionScriptComment">// to aggregate the columns by the Quarter dimension. 
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">colQueryAxis</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPQueryAxis</span> <span class="ActionScriptOperator">=</span> 
                <span class="ActionScriptDefault_Text">query</span>.<span class="ActionScriptDefault_Text">getAxis</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">OLAPQuery</span>.<span class="ActionScriptDefault_Text">COLUMN_AXIS</span><span class="ActionScriptBracket/Brace">)</span>;         
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">quarterSet</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">OLAPSet</span><span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">OLAPSet</span>;
            <span class="ActionScriptDefault_Text">quarterSet</span>.<span class="ActionScriptDefault_Text">addElements</span><span class="ActionScriptBracket/Brace">(</span>
                <span class="ActionScriptDefault_Text">cube</span>.<span class="ActionScriptDefault_Text">findDimension</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;QuarterDim&quot;</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">findAttribute</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Quarter&quot;</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">children</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">colQueryAxis</span>.<span class="ActionScriptDefault_Text">addSet</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">quarterSet</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">query</span>;       
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptComment">// Event handler to execute the OLAP query 
</span>        <span class="ActionScriptComment">// after the cube completes initialization.
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">runQuery</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">CubeEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// Get cube.
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">cube</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPCube</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">IOLAPCube</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">currentTarget</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// Create a query instance.
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">query</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IOLAPQuery</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getQuery</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cube</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// Execute the query.
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">token</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AsyncToken</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">cube</span>.<span class="ActionScriptDefault_Text">execute</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">query</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// Setup handlers for the query results.
</span>            <span class="ActionScriptDefault_Text">token</span>.<span class="ActionScriptDefault_Text">addResponder</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">AsyncResponder</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showResult</span>, <span class="ActionScriptDefault_Text">showFault</span><span class="ActionScriptBracket/Brace">))</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptComment">// Handle a query fault.
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">showFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span>, <span class="ActionScriptDefault_Text">token</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">Alert</span>.<span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Error in query.&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptComment">// Handle a successful query by passing the query results to 
</span>        <span class="ActionScriptComment">// the OLAPDataGrid control..
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">showResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span>, <span class="ActionScriptDefault_Text">token</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span>.<span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;No results from query.&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">return</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptDefault_Text">myOLAPDG</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">result</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">OLAPResult</span>;            
        <span class="ActionScriptBracket/Brace">}</span>        
      <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span>

    <span class="MXMLComponent_Tag">&lt;mx:OLAPCube</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">FlatSchemaCube</span><span class="MXMLDefault_Text">&quot; 
        dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">flatData</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot; 
        id=&quot;</span><span class="MXMLString">myMXMLCube</span><span class="MXMLDefault_Text">&quot;
        complete=&quot;</span><span class="ActionScriptDefault_Text">runQuery</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;<span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
         
        <span class="MXMLComponent_Tag">&lt;mx:OLAPDimension</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">CustomerDim</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPAttribute</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">Customer</span><span class="MXMLDefault_Text">&quot; dataField=&quot;</span><span class="MXMLString">customer</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPHierarchy</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">CustomerHier</span><span class="MXMLDefault_Text">&quot; hasAll=&quot;</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:OLAPLevel</span><span class="MXMLDefault_Text"> attributeName=&quot;</span><span class="MXMLString">Customer</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:OLAPHierarchy&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:OLAPDimension&gt;</span>
        
        <span class="MXMLComponent_Tag">&lt;mx:OLAPDimension</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">ProductDim</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPAttribute</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">Product</span><span class="MXMLDefault_Text">&quot; dataField=&quot;</span><span class="MXMLString">product</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPHierarchy</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">ProductHier</span><span class="MXMLDefault_Text">&quot; hasAll=&quot;</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:OLAPLevel</span><span class="MXMLDefault_Text"> attributeName=&quot;</span><span class="MXMLString">Product</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:OLAPHierarchy&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:OLAPDimension&gt;</span>
    
        <span class="MXMLComponent_Tag">&lt;mx:OLAPDimension</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">QuarterDim</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPAttribute</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">Quarter</span><span class="MXMLDefault_Text">&quot; dataField=&quot;</span><span class="MXMLString">quarter</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:OLAPHierarchy</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">QuarterHier</span><span class="MXMLDefault_Text">&quot; hasAll=&quot;</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:OLAPLevel</span><span class="MXMLDefault_Text"> attributeName=&quot;</span><span class="MXMLString">Quarter</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:OLAPHierarchy&gt;</span> 
        <span class="MXMLComponent_Tag">&lt;/mx:OLAPDimension&gt;</span>
        
        <span class="MXMLComponent_Tag">&lt;mx:OLAPMeasure</span><span class="MXMLDefault_Text"> name=&quot;</span><span class="MXMLString">Revenue</span><span class="MXMLDefault_Text">&quot; 
            dataField=&quot;</span><span class="MXMLString">revenue</span><span class="MXMLDefault_Text">&quot; 
            aggregator=&quot;</span><span class="MXMLString">SUM</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;/mx:OLAPCube&gt;</span>
    
    <span class="MXMLComponent_Tag">&lt;mx:Panel</span><span class="MXMLDefault_Text"> title=&quot;</span><span class="MXMLString">OLAPCube Control Example</span><span class="MXMLDefault_Text">&quot;
        height=&quot;</span><span class="MXMLString">75%</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">75%</span><span class="MXMLDefault_Text">&quot; layout=&quot;</span><span class="MXMLString">horizontal</span><span class="MXMLDefault_Text">&quot;
        paddingTop=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; paddingBottom=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; paddingLeft=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; paddingRight=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>

        <span class="MXMLComponent_Tag">&lt;MecGrid:MecGrid</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">myOLAPDG</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;/mx:Panel&gt;</span>
<span class="MXMLComponent_Tag">&lt;/mx:Application&gt;</span></pre></body>
</html>
